﻿@using System.Threading
@using FikriKibar.Common.Helpers
@using FikriKibar.Globalization
@using FikriKibar.UI.WebCommon.Helpers
@using FikriKibar.Entities.Composite.UserModels
@model AddModel

@{
    ViewBag.Title = @Resources.SignUp;
    Layout = "~/Views/Shared/HomeLayout.cshtml";
}


<div class="container" id="login-container">
    <div class="row">
        <div class="col-md-4 col-md-offset-4 text-center">
            <div id="login-logo"></div>
            <h3 class="login-header">FikriKibar CMS</h3>
        </div>
    </div>
    <div class="row">
        <div class="col-md-4 col-md-offset-4">
            <div class="login-panel panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">@Resources.SignUp</h3>
                </div>
                <div class="panel-body">
                    @using (Html.BeginForm("SignUp", "User", FormMethod.Post, new { @role = "form" }))
                    {
                        <fieldset>
                            <div class="form-group">
                                @Html.FikriKibarTextBoxFor(m => m.User.Username, new { @class = "form-control", @placeholder = Resources.Username, @maxlength = 32 })
                                @Html.ValidationMessageFor(m => m.User.Username)
                            </div>

                            <div class="form-group">
                                @Html.FikriKibarPasswordFor(m => m.User.Password, new { @class = "form-control", @placeholder = Resources.Password, @maxlength = 32 })
                                @Html.ValidationMessageFor(m => m.User.Password)
                            </div>
                            <div class="form-group">
                                @Html.FikriKibarPasswordFor(m => m.User.ConfirmPassword, new { @class = "form-control", @placeholder = Resources.ConfirmPassword, @maxlength = 32 })
                                @Html.ValidationMessageFor(m => m.User.ConfirmPassword)
                            </div>
                            <div class="form-group">
                                @Html.FikriKibarEmailFor(m => m.User.Email, new { @class = "form-control", @placeholder = Resources.Email, type = "email" })
                                @Html.ValidationMessageFor(m => m.User.Email)
                            </div>
                            <div class="form-group">
                                @Html.FikriKibarTextBoxFor(m => m.User.FirstName, new { @class = "form-control", @placeholder = Resources.FirstName, @maxlength = 64 })
                                @Html.ValidationMessageFor(m => m.User.FirstName)
                            </div>
                            <div class="form-group">
                                @Html.FikriKibarTextBoxFor(m => m.User.LastName, new { @class = "form-control", @placeholder = Resources.LastName, @maxlength = 64 })
                                @Html.ValidationMessageFor(m => m.User.LastName)
                            </div>


                            @if (ConfigurationHelper.GetAppSetting("UseSignUpCaptcha").ConvertToBoolean())
                            {
                                <div class="form-group">
                                    <img src="@Url.Action("Get", "Captcha")" alt="@Resources.Captcha" id="SignUpCaptchaImage" />
                                    <span id="SignUpCaptchaRefresh" class="RefreshCaptcha">@Resources.Refresh</span>
                                </div>
                                <div class="form-group">
                                    @Html.FikriKibarTextBoxFor(m => m.CaptchaValue, new { @class = "form-control", @placeholder = Resources.Captcha, @maxlength = 32 })
                                    @Html.ValidationMessageFor(m => m.CaptchaValue)
                                </div>
                            }
                            <div class="form-group">
                                @Html.FikriKibarDropDownListFor(m => m.SelectedLanguageCode, new SelectList(Model.LanguageList, "LanguageCode", "LanguageName", Thread.CurrentThread.CurrentCulture), new { @class = "form-control SignUpSelectedLanguageCode" })
                            </div>

                            <button class="btn btn-lg btn-success btn-block">@Resources.Save</button>
                        </fieldset>
                    }
                </div>
                <div class="panel-footer">
                    <div class="row">
                        <div class="col-lg-6 text-center">
                            <h6><a href="@Url.Action("Login", "User")"><span class="glyphicon glyphicon-user"></span>&nbsp;@Resources.UserLogin</a></h6>
                        </div>
                        <div class="col-lg-6 text-center">
                            <h6>
                                <a href="@Url.Action("ForgotPassword", "User")"><span class="glyphicon glyphicon-lock"></span>&nbsp;@Resources.ForgotPassword</a>
                            </h6>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12 text-center">
                    @Html.FikriKibarAlertFor(m => m.Message, "div", Model.Message, new { @class = "alert alert-danger" })
                </div>
            </div>

        </div>
    </div>
</div>


